#ifndef SNGPARSER
#define SNGPARSER

#include <qdom.h>
#include <qfile.h>
#include <qmessagebox.h>
#include <iostream>
#include <map>
#include <vector>

using namespace std;
class Note;
class sound;

typedef std::multimap<double,Note*> tabmultimap;

typedef struct
{
	QString title;
	QString artist;
	QString album;
	float bps;
	int beatoffset;
	float errortol;
}SNGINFO;

class sngParser
{
	public:
		sngParser();
		~sngParser();
		tabmultimap parse( const QString fileName, QWidget *parent , string* directoryhint, string* filename );
		void parseProperties(QDomElement e, string* songpath, string* filename);
		void parseData(QDomElement e);
		void createSngFile(const char* filename, multimap <double,Note*> notes, sound *song);
		QString getCurrentSngPath() {return m_currentsngpath;};
		SNGINFO *m_snginfo;
	private:
		tabmultimap m_tablature;
		QDomDocument m_domTree;
		QString m_currentsngpath;
};

#endif
